<template>
    <div class="wrapper">
        <div class="swiper">
            <swiper :options="swiperOption" >
                <swiper-slide v-for="item of swiperList" :key='item.id'>
                 <img class="swiper-img" :src='item.imgUrl' alt="图片到外太空了"/>
                </swiper-slide>
                <div class="swiper-pagination"  slot="pagination"></div>
            </swiper>
        </div>
    </div>
</template>
<script>
export default {
    name:"HomeSwiper",
    data(){
        return{
            swiperOption:{
                pagination:'.swiper-pagination',
                loop:true,
                autoplay:2000
            },
            swiperList:[{
                id:'0001',
                imgUrl:'https://cms-bucket.nosdn.127.net/3c873c1716374cfa88d34c2a36cfda8e20180402182203.jpeg'
            },
            {
                id:'0002',
                imgUrl:'https://cms-bucket.nosdn.127.net/3c873c1716374cfa88d34c2a36cfda8e20180402182203.jpeg'
            }]
        }
    }
}
</script>
<style lang="stylus" scoped>
    //>>> 样式穿透，让wrapper下所有子组件的swiper-pagination-bullet-active都生效
    .wrapper >>> .swiper-pagination-bullet-active
            background:pink !important
    .wrapper
        height:0
        overflow:hidden
        width:100%
        padding-bottom:32.53% //相当于宽度的31.25%
        .swiper-img
            width:100%
       
</style>